#include <gtest/gtest.h>
#include "core/utils/string_helper.h"

using namespace aliyun;

TEST(core_utils, string_helper) {

  string str("A-B*C+D/E");
  const string& rstr = string_ToLower(str);
  ASSERT_STREQ(str.c_str(), "a-b*c+d/e");
  ASSERT_STREQ(rstr.c_str(), "a-b*c+d/e");
  ASSERT_EQ(&str, &rstr);

  ASSERT_STREQ(string_UrlEncode("test urlencode").c_str(), "test+urlencode");
  string test_replace("abcdbce");
  string_replace(test_replace, "bc", "cd");
  ASSERT_STREQ(test_replace.c_str(), "acddcde");

  ASSERT_STREQ(string_UrlPrecentEncode("test urlencode").c_str(), "test%20urlencode");

  ASSERT_STRNE(string_Uuid("test key").c_str(), string_Uuid("test key").c_str());
}

// end of file
